package com.bingbing.back.service.Impl;

import com.bingbing.back.dto.CaListChangeDto;
import com.bingbing.back.dto.CaListDto;
import com.bingbing.back.mapper.CaListMapper;
import com.bingbing.back.po.CaList;
import com.bingbing.back.service.CaListService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CaListServiceImpl implements CaListService {

    @Resource
    private CaListMapper caListMapper;

    @Override
    public int AddItem(CaListDto dto) {
        int row  = 0;

        row = caListMapper.AddItem(dto);

        return row;
    }

    @Override
    public List<CaList> showAll(CaListDto dto) {
        List<CaList> table = null;

        table = caListMapper.showAll(dto);

        return table;
    }

    @Override
    public int changeIndex(CaListChangeDto dto) {
        int row = 0;

        row = caListMapper.changeIndex(dto);

        return row;
    }
    @Override
    public int getSumItem(CaListDto dto){
        int sum = 0;
        sum = caListMapper.getSumItem(dto);
        return sum;
    }
    @Override
    public int delete(CaListDto dto){
        int row = 0;

        row = caListMapper.delete(dto);

        return row;
    }
    @Override
    public CaList isExist(CaListDto dto){
        CaList caList = null;

        caList = caListMapper.isExist(dto);

        return caList;
    }
}
